<#if param=='jobs'><#assign menu="jobs"><#else><#assign menu="order"></#if>
<#assign submenu="update_order">
<#include "/manage/head.ftl">
<!--main content start-->
<style type="text/css">

</style>
<section id="main-content">
	<section class="wrapper">
		<!-- page start-->
		<form id="update_order_form" class="form-horizontal" action="${BASE_PATH}/manage/user/order/update.json" 
		 autocomplete="off"  method="post">
			<fieldset>
		<div class="row">
			<input type="hidden" name="id" value="${order.id}">
			<div class="col-lg-12">
				<section class="panel">
					<header class="panel-heading"> 
						修改订单
					</header>
					<div class="panel-body">
						<div class="form-group">
                          <label class="col-sm-2 col-sm-2 control-label">用户名</label>
                          <div class="col-sm-10">
                              ${order.userName}
                          </div>
                        </div>
                        <div class="form-group">
                          <label class="col-sm-2 col-sm-2 control-label">收件人</label>
                          <div class="col-sm-10">
                              <input type="text" style="font-size:15px;width: 300px;" class="form-control" name="linkman"
                              	placeholder="收件人" id="name" value="${order.linkman}" />
                          </div>
                        </div>
                        <div class="form-group">
                          <label class="col-sm-2 col-sm-2 control-label">订单总价</label>
                          <div class="col-sm-10">
                              ${order.totalprice}
                          </div>
                        </div>
                         <div class="form-group">
                          <label class="col-sm-2 col-sm-2 control-label">地址</label>
                          <div class="col-sm-10">
                              <input type="text" style="font-size:15px;width: 300px;" class="form-control" name="address"
                              	placeholder="地址" id="name" value="${order.address}" />
                          </div>
                        </div>
                        <div class="form-group">
                          <label class="col-sm-2 col-sm-2 control-label">邮编</label>
                          <div class="col-sm-10">
                              <input type="text" style="font-size:15px;width: 300px;" class="form-control" name="zipCode"
                              	placeholder="邮编" id="name" value="${order.zipCode}" />
                          </div>
                        </div>
                        <div class="form-group">
                          <label class="col-sm-2 col-sm-2 control-label">电话</label>
                          <div class="col-sm-10">
                              <input type="text" style="font-size:15px;width: 300px;" class="form-control" name="mobile"
                              	placeholder="电话" id="name" value="${order.mobile}" />
                          </div>
                        </div>
                        <div class="form-group">
                          <label class="col-sm-2 col-sm-2 control-label">备注</label>
                          <div class="col-sm-10">
                              <input type="text" style="font-size:15px;width: 300px;" class="form-control" name="remark"
                              	placeholder="备注" id="name" value="${order.remark}" />
                          </div>
                        </div>
                        <div class="form-group">
                          <label class="col-sm-2 col-sm-2 control-label">订单时间</label>
                          <div class="col-sm-10">
                              ${order.createTime?string("yyyy-MM-dd")}
                          </div>
                        </div>  
                        <div>
                        <table class="table table-bordered" style="width:60%">
				            <tbody><tr class=""><th colspan="2">商品</th></tr>
				            <#list order.orderDetails as detail>
				            <tr>
				            <td width="60">
				            <#list detail.product.pictureList as pic>
								<img src="${BASE_PATH}/${pic.url}" width="60" />
								<#break/>
							</#list>
				            </td>
				            <td class="badge-corner">
				                <span class="text-red text-small"></span> <a href="/product/${detail.product.productId}.htm" target="_blank">${detail.product.productName} </a>
				                <div class="float-right padding-top" align="right">
				                    ¥${detail.productPrice} × <span>${detail.productNum}</span><br>
				                </div>
				                </td>
				            </tr>
				            <tr class=""><td colspan="2" align="right">总计： ¥<span id="total">${detail.productPrice*detail.productNum}</span></td></tr>
				            </#list>
				            </tbody>
				           </table>
                        </div> 
                        <div class="form-group">
                      	  <div class="col-lg-offset-2 col-lg-10">
                          <button class="btn btn-shadow btn-primary" type="submit">修改</button>
                          </div>
                      </div>
					</div>
				</section>
			</div>
		</div>
		</fieldset>
		</form>
		<!-- page end-->
	</section>
</section>
<!--main content end-->
<script type="text/javascript">
$(function(){
	$('#update_order_form').ajaxForm({
		dataType : 'json',
		success : function(data) {
			if (data.result) {
				bootbox.alert("保存成功，将刷新页面", function() {
					window.location.reload();
					
				});
			}else{
				showErrors($('#add_order_form'),data.errors);
			}
		}
	});
});
</script>
<#include "/manage/foot.ftl">
